<?php 
error_reporting(E_ERROR);
session_start();
require_once('constants_shop.php');
require_once('functions.php');
include('classes/userClass.php');



#conect to shop database	
$shopObj = new mysqlClass();

	if(isset($_POST['make_cities'])){
		$params = array($_POST['make_cities']);
		$data = $shopObj->fetch_result("SELECT * FROM loccities WHERE countryID=?",$params);
		$tosend = '<select id="city" name="city" class="select2" data-placeholder="Click to Choose...">';
		foreach ($data as $key => $value) {
			$tosend .= "<option value ='{$value['cityID']}'>{$value['shortCity']}</option>";
		}
		$$tosend .= "</select>";
		echo $tosend;
	}
	if(isset($_POST['save_profile'])){
			echo "<pre>";
			print_r($_SESSION);
			echo "</pre>";    			

			$pramas=array();
			$params['hostname']='localhost';
			$params['dbname']='neoflux_neoflux';
			$params['username']='neoflux_neoflux';
			$params['password']='7dTh9mLkry2H';
			
			$userObj = new mysqlClass($params);

		// 	$params = array();
		// 	$params['email']= $_POST['name'];
		// 	$params['company']=$_POST['company'];
		// 	$params['phone'] = $_POST['phone'];
		// 	$params['city_id']= $_POST['city'];
		// 	$params['country_id']= $_POST['state'];
		// 	$params['address'] = $_POST['address'];
		// 	$parasm = array($_POST['name'],$_POST['company'],$_POST['phone'],$_POST['city'],$_POST['state'],$_POST['address']);
		// $userObj->update("UPDATE users SET  email =?, company=?,phone=?,city_id=?,country_id=?,address=? WHERE session_user='{$_SESSION['session_user']}'  ",$params);
	}
?>